package cn.s1995.sloth.bizs.entity;

import cn.s1995.sloth.common.core.convert.NumberFormatConvert;
import cn.s1995.sloth.bizs.entity.base.BaseEntity;
import cn.s1995.sloth.common.core.convert.JoinUrlPrefixConvert;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

/**
 * 产品
 *
 * @author Lex
 * @date 2023-12-14 10:02:00
 */
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "产品")
@TableName(value = "biz_prod", autoResultMap = true)
@ColumnWidth(30)
public class Prod extends BaseEntity {


	/**
	* ID
	*/
	@NotNull(groups = {BaseEntity.ValidGroup.Edit.class})
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
	@ExcelProperty("ID")
    private Long id;

	/**
	* 店铺id
	*/
    @Schema(description = "店铺id")
	@ExcelProperty("店铺id")
    private Long shopId;

	/**
	* 名称
	*/
    @Schema(description = "名称")
	@TableField("`name`")
    private String name;

	/**
	* 简介
	*/
    @Schema(description = "简介")
    private String brief;

	/**
	* 分类id
	*/
    @Schema(description = "分类id")
    private Long categoryId;

	/**
	* 分类path
	*/
    @Schema(description = "分类path")
    private String categoryPath;

	/**
	* 原价
	*/
    @Schema(description = "原价")
    private BigDecimal originAmount;

	/**
	* 价格
	*/
    @Schema(description = "价格")
    private BigDecimal amount;

	/**
	* 货号
	*/
    @Schema(description = "货号")
    private String sn;

	/**
	* 型号
	*/
    @Schema(description = "型号")
    private String model;

	/**
	 * 产品主图
	 */
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
	@Schema(description = "产品主图")
	private String pic;

	/**
	* banner图
	*/
	@JsonSerialize(using = JoinUrlPrefixConvert.class)
    @Schema(description = "banner图")
	@TableField(typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
    private List<String> banner;

	/**
	* 缩略图
	*/
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
    @Schema(description = "缩略图")
	@TableField(typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
    private List<String> thumbnail;

	/**
	* 详细描述
	*/
    @Schema(description = "详细描述")
	@TableField("`desc`")
    private String desc;

	/**
	 * 详细描述图片
	 */
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
	@Schema(description = "详细描述图片")
	@TableField(typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
	private List<String> descPic;

	/**
	* 销量
	*/
    @JsonSerialize(using = NumberFormatConvert.class)
    @Schema(description = "销量")
    private Integer saleNum;

	/**
	* 总库存
	*/
    @Schema(description = "总库存")
    private Integer totalStocks;

	/**
	* 是否上架
	*/
    @Schema(description = "是否上架")
    private Boolean isSale;

	/**
	* 是否可定制
	*/
    @Schema(description = "是否可定制")
    private Boolean isCustomizable;

	/**
	* 是否推荐
	*/
    @Schema(description = "是否推荐")
    private Boolean isRecommend;

	/**
	* 是否热门
	*/
    @Schema(description = "是否热门")
    private Boolean isHot;

	/**
	* 配送类型：1.物流
	*/
    @Schema(description = "配送类型：1.物流")
    private Integer deliveryType;

	/**
	* 发货地址
	*/
    @Schema(description = "发货地址")
    private String deliveryAddress;

	/**
	* 发货周期
	*/
    @Schema(description = "发货周期")
    private Integer deliveryCycle;

	/**
	* 运费模板id
	*/
    @Schema(description = "运费模板id")
    private Long deliveryTemplateId;

	/**
	* 佣金类型：1.百分比 2.固定额
	*/
    @Schema(description = "佣金类型：1.百分比 2.固定额")
    private Integer commissionType;

	/**
	* 佣金值
	*/
    @Schema(description = "佣金值")
    private BigDecimal commissionValue;

	/**
	* 排序
	*/
    @Schema(description = "排序")
    private Integer sort;

	/**
	* 来源
	*/
    @Schema(description = "来源")
    private String source;

	/**
	* 来源地址
	*/
    @Schema(description = "来源地址")
    private String sourceUrl;

	/**
	 * 版本号
	 */
	@Schema(description = "版本号")
	private Integer version;

	/**
	 * 备注
	 */
	@Schema(description = "备注")
	private String remark;

	/**
	 * 三眼狐id
	 */
	@Schema(description = "三眼狐id")
	private String syhId;

	/**
	* 删除标识
	*/
	@TableLogic
	@TableField
    @Schema(description = "删除标识", hidden = true)
    private Boolean delFlag;
}
